# Maintainer: Christian Rebischke <chris.rebischke@archlinux.org>
# Contributor: Stefan Tatschner <stefan@rumpelsepp.org>
# Contributor: Gökberk Yaltıraklı <aur at gkbrk dot com>
# Contributor: Drew DeVault <sir@cmpwn.com>

pkgname=aerc
pkgver=0.14.0
pkgrel=1
pkgdesc='Email Client for your Terminal'
arch=('loong64' 'x86_64')
url='https://git.sr.ht/~rjarry/aerc'
license=('MIT')
depends=('notmuch-runtime' 'gawk')
makedepends=('go' 'scdoc')
optdepends=('w3m: for showing HTML messages'
            'dante: for showing HTML messages')
provides=('aerc')
conflicts=('aerc')
source=("$pkgname-$pkgver.tar.gz::https://git.sr.ht/~rjarry/${pkgname}/archive/${pkgver}.tar.gz")
sha512sums=('d12502a809c5163bc81bfa3bfbd471a03f4e8e56084e00e7bb52619a8ac6f34df78342c0e8e82d6cdfd4fe1bc0c375dd65366a442875621b20bbd040a9025831')

build() {
    cd "$srcdir/$pkgname-$pkgver"
    export CGO_LDFLAGS="${LDFLAGS}"
    export CGO_CFLAGS="${CFLAGS}"
    export CGO_CPPFLAGS="${CPPFLAGS}"
    export CGO_CXXFLAGS="${CXXFLAGS}"
    export GOFLAGS="-buildmode=pie -trimpath -modcacherw -tags=notmuch"
    make PREFIX=/usr
}

package() {
    cd "$srcdir/$pkgname-$pkgver"
    make PREFIX=/usr DESTDIR=$pkgdir install
    install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/aerc/"
}
